package com.wxh.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author wxh
 * @since 2020-04-15
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ToString
public class Flights implements Serializable {

    private static final long serialVersionUID=1L;

    private Integer id;

    @TableField("flightCode")
    private String flightCode;
    //入参
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    //出餐
    @JsonFormat(
            pattern = "yyyy-MM-dd"
    )
    @TableField("flightDate")
    private LocalDateTime flightDate;

    private String airline;

    private String type;

    @TableField("takeoffAirportId")
    private Integer takeoffAirportId;

    @TableField("landingAirportId")
    private Integer landingAirportId;
    @JsonFormat(
            pattern = "yyyy-MM-dd"
    )
    @TableField("takeoffTime")
    private LocalDateTime takeoffTime;
    @JsonFormat(
            pattern = "yyyy-MM-dd"
    )
    @TableField("landingTime")
    private LocalDateTime landingTime;

    @TableField("flightTime")
    private String flightTime;

    @TableField("stopAirport")
    private String stopAirport;

    @TableField("referencePrice")
    private Integer referencePrice;

 @TableField(exist = false)
    private String start;

    @TableField(exist = false)
    private String end;

//    public static void main(String[] args) {
//        String yyyyMMddHHmm = new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date());
//        System.out.println(yyyyMMddHHmm);
//    }
}
